/* eslint-disable */
// @ts-ignore
import request from '@/utils/request';
import { CustomRequestOptions } from '@/interceptors/request';

import * as API from './types';

/** 分页查询用户 GET /user */
export async function userGetUserPage({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserGetUserPageParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelResponseDataListModelUserModel_>('/user', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 编辑用户 PUT /user */
export async function userEditUser({
  params,
  body,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserEditUserParams;
  body: API.EditUserModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/user', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    params: {
      ...params,
    },
    data: body,
    ...(options || {}),
  });
}

/** 新增用户 POST /user */
export async function userAddUser({
  body,
  options,
}: {
  body: API.AddUserModel;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/user', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除用户 DELETE /user */
export async function userDeleteUser({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserDeleteUserParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/user', {
    method: 'DELETE',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 停启用用户 PUT /user/enabled */
export async function userEnabledUser({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.UserEnabledUserParams;
  options?: CustomRequestOptions;
}) {
  return request<API.ResponseModelObject_>('/user/enabled', {
    method: 'PUT',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}
